//https://leetcode.cn/problems/sum-of-two-integers/
class Solution {
    public int getSum(int a, int b) {
        //无进位相加 -> 异或
        int resN = a ^ b;
        //得到其进位
        int carry = (a & b) << 1;
        //循环将无进位相加的结果和其进位相加
        while(carry != 0) {
            a = resN;
            b = carry;
            resN = a ^ b;
            carry = (a & b) << 1;
        }
        return resN;
    }
}